/**
 * 简化$.get操作，配合后台返回的JSON
 * 
 * @author QJ
 * @param url
 * @param callback
 */
function ajaxGet(url, callback) {
	$.get(url, function(result) {
		if (result.success) {
			if (jQuery.isFunction(callback)) {
				callback.call();
			}
		}
		showInfoForCallBack(result);
	}, "json");
}

/**
 * 自定义$.post操作，配合后台返回的JSON
 * 
 * @author QJ
 * @param url
 * @param callback
 */
function ajaxPost(url, callback) {
	$.post(url, function(result) {
		if (result.success) {
			if (jQuery.isFunction(callback)) {
				callback.call();
			}
			if (result.msg)
				showMsg(result.msg);
		} else {
			if (result.msg)
				showAlert(result.msg);
		}
	}, "json");
}

/**
 * 公共的启动审批流程页面
 * 
 * @author QJ
 * @param url
 * @param callback
 */
function wflStart(url, callback) {
	$.get(url, function(result) {
		if (result.success) {
			if (jQuery.isFunction(callback)) {
				callback.call();
			}
			if (result.msg)
				showMsg(result.msg);
			// top.window.mainpage.mainTabs.addModule("[流程启动]",kl.ctx+"/bpm/confForm/from-startProcessPage?processInstanceId="+result.obj)
			window.parent.addTab("processStart", "[流程启动]", kl.ctx + "/bpm/confForm/from-startProcessPage?processInstanceId=" + result.obj);
		} else {
			if (jQuery.isFunction(callback)) {
				callback.call();
			}
			if (result.msg)
				showAlert(result.msg);
		}
	}, "json");
}
/**
 * 获取“星期几”
 * 
 * @param date
 */
function fn_getWeekly(date) {
	var day = $.date.getDayOfWeek(date ? date : new Date());
	if (day == 0)
		return "星期日";
	else if (day == 1)
		return "星期一";
	else if (day == 2)
		return "星期二";
	else if (day == 3)
		return "星期三";
	else if (day == 4)
		return "星期四";
	else if (day == 5)
		return "星期五";
	else
		return "星期六";
}